In [22]:
import pandas as pd
from sklearn import tree
from sklearn import metrics
from mlxtend.feature_selection import SequentialFeatureSelector
from sklearn.cross_validation import KFold, StratifiedKFold, cross_val_score
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.pipeline import Pipeline
from sklearn.model_selection import cross_val_predict
from sklearn import linear_model
from mlxtend.feature_selection import SequentialFeatureSelector as SFS
from mlxtend.plotting import plot_sequential_feature_selection as plot_sfs
import matplotlib.pyplot as plt
import numpy as np
from __future__ import print_function

In [23]:
df_match = pd.read_csv('dataset.csv')
all_match_attributes=df_match.columns.values.tolist()
after_match_attributes =['home_team_goal', 'away_team_goal', 'possession_home', 'shoton_home', 'shoton_away', 
                      'shotoff_home', 'shotoff_away', 'corner_home', 'corner_away', 'cross_home', 'cross_away', 
                      'foulcommit_home', 'foulcommit_away', 'rcard_home', 'rcard_away', 'ycard_home', 'ycard_away', 
                      'throwin_home', 'throwin_away']
before_match_attributes = list(set(all_match_attributes) - set(after_match_attributes))
before_match_all=before_match_attributes+['possession_home']
df_before_match = df_match[before_match_all]

In [24]:
holdout_per=0.2
df_before_match_out_sample = df_before_match.sample(frac=holdout_per)
df_before_match_out_testtarget = df_before_match_out_sample['possession_home']
df_before_match_out_test =df_before_match_out_sample[before_match_attributes]

df_before_match_out_left = df_before_match.iloc[list(set(df_before_match.index.values.tolist())-set(df_before_match_out_sample.index.values.tolist()))]
df_before_match_out_training = df_before_match_out_left[before_match_attributes]
df_before_match_out_trainingtarget = df_before_match_out_left['possession_home']

In [25]:
lr = linear_model.LinearRegression()
sfs_greedy = SFS(lr, 
           k_features=df_before_match_out_training.shape[1], 
           forward=True, 
           floating=False, 
           verbose=2,
           scoring='neg_mean_squared_error',
           cv=10)
sfs_greedy = sfs_greedy.fit(df_before_match_out_training.as_matrix(), df_before_match_out_trainingtarget.as_matrix())
fig = plot_sfs(sfs_greedy.get_metric_dict(), kind='std_err')
fig.set_size_inches(18.5, 10.5, forward=True)
plt.title('Sequential Forward Selection (w. StdErr)')
plt.grid()
plt.show()


[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  41 out of  41 | elapsed:    0.4s finished

[2017-11-13 00:47:36] Features: 1/41 -- score: -58.7289698381[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  40 out of  40 | elapsed:    0.4s finished

[2017-11-13 00:47:36] Features: 2/41 -- score: -53.3892854073[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  39 out of  39 | elapsed:    0.6s finished

[2017-11-13 00:47:37] Features: 3/41 -- score: -52.5486830747[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  38 out of  38 | elapsed:    0.6s finished

[2017-11-13 00:47:37] Features: 4/41 -- score: -51.6461824979[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  37 out of  37 | elapsed:    0.5s finished

[2017-11-13 00:47:38] Features: 5/41 -- score: -51.2902865218[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  36 out of  36 | elapsed:    0.5s finished

[2017-11-13 00:47:38] Features: 6/41 -- score: -51.1051971651[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  35 out of  35 | elapsed:    0.6s finished

[2017-11-13 00:47:39] Features: 7/41 -- score: -50.8920514769[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  34 out of  34 | elapsed:    0.7s finished

[2017-11-13 00:47:40] Features: 8/41 -- score: -50.8261008571[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  33 out of  33 | elapsed:    0.6s finished

[2017-11-13 00:47:40] Features: 9/41 -- score: -50.7505603816[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  32 out of  32 | elapsed:    1.1s finished

[2017-11-13 00:47:41] Features: 10/41 -- score: -50.7005184699[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  31 out of  31 | elapsed:    0.6s finished

[2017-11-13 00:47:42] Features: 11/41 -- score: -50.6448873888[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  30 out of  30 | elapsed:    1.0s finished

[2017-11-13 00:47:43] Features: 12/41 -- score: -50.6056971801[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  29 out of  29 | elapsed:    0.8s finished

[2017-11-13 00:47:44] Features: 13/41 -- score: -50.5971663817[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  28 out of  28 | elapsed:    0.7s finished

[2017-11-13 00:47:45] Features: 14/41 -- score: -50.5178569556[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  27 out of  27 | elapsed:    0.7s finished

[2017-11-13 00:47:45] Features: 15/41 -- score: -50.5094775166[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  26 out of  26 | elapsed:    0.7s finished

[2017-11-13 00:47:46] Features: 16/41 -- score: -50.51439094[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  25 out of  25 | elapsed:    0.9s finished

[2017-11-13 00:47:47] Features: 17/41 -- score: -50.5348768024[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  24 out of  24 | elapsed:    0.6s finished

[2017-11-13 00:47:48] Features: 18/41 -- score: -50.5233740871[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  23 out of  23 | elapsed:    0.6s finished

[2017-11-13 00:47:48] Features: 19/41 -- score: -50.5402787234[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  22 out of  22 | elapsed:    0.6s finished

[2017-11-13 00:47:49] Features: 20/41 -- score: -50.5578008215[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  21 out of  21 | elapsed:    0.6s finished

[2017-11-13 00:47:49] Features: 21/41 -- score: -50.5815246656[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  20 out of  20 | elapsed:    0.6s finished

[2017-11-13 00:47:50] Features: 22/41 -- score: -50.5886990181[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  19 out of  19 | elapsed:    0.6s finished

[2017-11-13 00:47:51] Features: 23/41 -- score: -50.6243855568[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  18 out of  18 | elapsed:    0.6s finished

[2017-11-13 00:47:51] Features: 24/41 -- score: -50.6708489597[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  17 out of  17 | elapsed:    0.6s finished

[2017-11-13 00:47:52] Features: 25/41 -- score: -50.7333998889[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  16 out of  16 | elapsed:    0.6s finished

[2017-11-13 00:47:52] Features: 26/41 -- score: -50.7925769304[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  15 out of  15 | elapsed:    0.6s finished

[2017-11-13 00:47:53] Features: 27/41 -- score: -50.8182544361[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  14 out of  14 | elapsed:    0.5s finished

[2017-11-13 00:47:53] Features: 28/41 -- score: -50.8837492159[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  13 out of  13 | elapsed:    0.6s finished

[2017-11-13 00:47:54] Features: 29/41 -- score: -50.9487811048[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  12 out of  12 | elapsed:    0.5s finished

[2017-11-13 00:47:54] Features: 30/41 -- score: -51.0153010109[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  11 out of  11 | elapsed:    0.5s finished

[2017-11-13 00:47:55] Features: 31/41 -- score: -51.0914580012[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  10 out of  10 | elapsed:    0.4s finished

[2017-11-13 00:47:55] Features: 32/41 -- score: -51.1678287847[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   9 out of   9 | elapsed:    0.4s finished

[2017-11-13 00:47:56] Features: 33/41 -- score: -51.2540884582[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   8 out of   8 | elapsed:    0.4s finished

[2017-11-13 00:47:56] Features: 34/41 -- score: -51.3523402132[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   7 out of   7 | elapsed:    0.3s finished

[2017-11-13 00:47:57] Features: 35/41 -- score: -51.4545664495[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   6 out of   6 | elapsed:    0.3s finished

[2017-11-13 00:47:57] Features: 36/41 -- score: -51.5610306069[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   5 out of   5 | elapsed:    0.3s finished

[2017-11-13 00:47:57] Features: 37/41 -- score: -51.6776422551[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   4 out of   4 | elapsed:    0.2s finished

[2017-11-13 00:47:57] Features: 38/41 -- score: -51.8162235084[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   3 out of   3 | elapsed:    0.2s finished

[2017-11-13 00:47:57] Features: 39/41 -- score: -51.9941470661[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   2 out of   2 | elapsed:    0.1s finished

[2017-11-13 00:47:58] Features: 40/41 -- score: -52.1689079911[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s finished

[2017-11-13 00:47:58] Features: 41/41 -- score: -52.3437553235

In [26]:
df_features_forward_greedy = pd.DataFrame.from_dict(sfs_greedy.get_metric_dict()).T
df_features_forward_greedy


Out[26]:
avg_score ci_bound cv_scores feature_idx std_dev std_err
1 -58.729 13.6689 [-37.4677973768, -33.6521225601, -42.446939286... (8,) 18.404 6.13466
2 -53.3893 11.8031 [-37.4085971788, -33.3538213249, -38.17086898,... (8, 14) 15.8919 5.29729
3 -52.5487 11.5306 [-40.5448889297, -33.7908060261, -36.130671567... (8, 4, 14) 15.525 5.17499
4 -51.6462 11.6248 [-40.9979286367, -34.3073129744, -33.714687223... (8, 18, 4, 14) 15.6518 5.21727
5 -51.2903 11.7016 [-39.0898452124, -33.8116966977, -34.431368342... (4, 8, 14, 18, 19) 15.7553 5.25175
6 -51.1052 11.4419 [-38.0110040218, -33.7795004351, -34.87955241,... (4, 8, 14, 18, 19, 29) 15.4055 5.13516
7 -50.8921 11.1997 [-38.5144679544, -34.5026858283, -35.596701856... (4, 8, 14, 16, 18, 19, 29) 15.0794 5.02647
8 -50.8261 11.2098 [-38.3765655068, -34.3163244505, -35.584880161... (4, 37, 8, 14, 16, 18, 19, 29) 15.093 5.031
9 -50.7506 11.2172 [-38.3022111224, -34.6306287177, -35.889225353... (4, 8, 14, 16, 18, 19, 21, 29, 37) 15.103 5.03434
10 -50.7005 11.1924 [-38.2032136545, -34.3155400654, -36.337505741... (4, 8, 14, 16, 18, 19, 21, 29, 31, 37) 15.0696 5.0232
11 -50.6449 11.1133 [-38.4026056558, -34.3505375776, -36.262873512... (4, 8, 9, 14, 16, 18, 19, 21, 29, 31, 37) 14.9631 4.9877
12 -50.6057 11.1371 [-37.8370282807, -33.9426594389, -36.131244535... (4, 8, 9, 14, 16, 18, 19, 21, 29, 31, 32, 37) 14.9952 4.99841
13 -50.5972 11.1849 [-37.7281145137, -33.7649188255, -36.126451567... (4, 8, 9, 14, 16, 18, 19, 21, 29, 31, 32, 34, 37) 15.0595 5.01983
14 -50.5179 11.1246 [-37.5690466059, -33.6631464507, -36.491006094... (4, 8, 9, 14, 16, 18, 19, 21, 26, 29, 31, 32, ... 14.9784 4.99279
15 -50.5095 10.9609 [-37.267840265, -33.854925969, -36.7490412027,... (4, 8, 9, 14, 16, 18, 19, 21, 26, 29, 31, 32, ... 14.7579 4.91931
16 -50.5144 10.9684 [-37.2149055747, -33.8414719438, -36.735820806... (4, 8, 9, 14, 15, 16, 18, 19, 21, 26, 29, 31, ... 14.7681 4.92269
17 -50.5349 10.9509 [-37.417806343, -33.7374990871, -37.1864269802... (4, 8, 9, 14, 15, 16, 18, 19, 21, 26, 29, 31, ... 14.7445 4.91483
18 -50.5234 10.9793 [-37.3374969057, -33.5459434165, -36.995863156... (4, 8, 9, 14, 15, 16, 18, 19, 21, 25, 26, 29, ... 14.7827 4.92756
19 -50.5403 10.8435 [-37.7709128441, -34.1613830866, -36.907601091... (4, 8, 9, 14, 15, 16, 18, 19, 21, 25, 26, 27, ... 14.5998 4.86661
20 -50.5578 10.9664 [-37.5003482012, -33.9096213377, -36.818504030... (4, 8, 9, 14, 15, 16, 18, 19, 21, 23, 25, 26, ... 14.7653 4.92176
21 -50.5815 10.8605 [-36.9235198403, -34.0273312201, -37.625774458... (4, 7, 8, 9, 14, 15, 16, 18, 19, 21, 23, 25, 2... 14.6228 4.87425
22 -50.5887 10.6434 [-38.2239851046, -33.8776648162, -37.180484151... (2, 4, 7, 8, 9, 14, 15, 16, 18, 19, 21, 23, 25... 14.3305 4.77683
23 -50.6244 10.6484 [-38.2050458238, -33.8242467268, -37.162471256... (2, 4, 7, 8, 9, 14, 15, 16, 18, 19, 21, 23, 25... 14.3372 4.77906
24 -50.6708 10.6141 [-37.9919494418, -33.7048624103, -36.982882272... (0, 2, 4, 7, 8, 9, 14, 15, 16, 18, 19, 21, 23,... 14.291 4.76367
25 -50.7334 10.6437 [-37.9927505433, -33.6917842112, -37.167532951... (0, 2, 4, 7, 8, 9, 14, 15, 16, 18, 19, 21, 23,... 14.3309 4.77695
26 -50.7926 10.655 [-38.0788122032, -33.9151677521, -37.220912394... (0, 2, 4, 7, 8, 9, 14, 15, 16, 17, 18, 19, 21,... 14.3461 4.78203
27 -50.8183 10.5474 [-38.3421978901, -34.2926283276, -36.904463036... (0, 2, 3, 4, 7, 8, 9, 14, 15, 16, 17, 18, 19, ... 14.2012 4.73372
28 -50.8837 10.5988 [-38.1899632427, -34.4398863025, -36.790505341... (0, 2, 3, 4, 7, 8, 9, 12, 14, 15, 16, 17, 18, ... 14.2704 4.75682
29 -50.9488 10.6091 [-38.3673053805, -34.4654642781, -36.812002731... (0, 2, 3, 4, 7, 8, 9, 12, 14, 15, 16, 17, 18, ... 14.2842 4.7614
30 -51.0153 10.5366 [-38.283503843, -34.5304392925, -36.9100796902... (0, 2, 3, 4, 7, 8, 9, 12, 14, 15, 16, 17, 18, ... 14.1867 4.7289
31 -51.0915 10.6862 [-38.0804753003, -34.3770040789, -37.120038242... (0, 2, 3, 4, 7, 8, 9, 12, 14, 15, 16, 17, 18, ... 14.3881 4.79603
32 -51.1678 10.7111 [-38.0837965481, -34.389972527, -37.1455540782... (0, 1, 2, 3, 4, 7, 8, 9, 12, 14, 15, 16, 17, 1... 14.4215 4.80718
33 -51.2541 10.5636 [-39.7453883135, -33.9928250901, -37.502896145... (0, 1, 2, 3, 4, 7, 8, 9, 12, 14, 15, 16, 17, 1... 14.223 4.74101
34 -51.3523 10.5883 [-39.7963747212, -34.0273242614, -37.508956594... (0, 1, 2, 3, 4, 5, 7, 8, 9, 12, 14, 15, 16, 17... 14.2563 4.7521
35 -51.4546 10.621 [-39.8843712229, -34.0426710621, -37.473312091... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16,... 14.3003 4.76678
36 -51.561 10.6293 [-39.8306171226, -33.9311894079, -37.610886776... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16,... 14.3114 4.77047
37 -51.6776 10.6524 [-39.7812764787, -33.8648868569, -37.706374010... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16,... 14.3426 4.78085
38 -51.8162 10.5379 [-40.0225616642, -34.6215216995, -38.021994292... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16,... 14.1884 4.72948
39 -51.9941 10.4788 [-40.7927401909, -34.6496941834, -38.745911429... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15,... 14.1088 4.70293
40 -52.1689 10.3856 [-41.7721913235, -34.6381983809, -39.383535235... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14,... 13.9833 4.66111
41 -52.3438 10.8884 [-41.0492286076, -33.982064226, -39.1396631043... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 14.6603 4.88676

simple greedy solution:


In [27]:
greedy_selected_columns_index=list()

selected_column_indice=df_features_forward_greedy[df_features_forward_greedy['avg_score'] == df_features_forward_greedy['avg_score'].max()]['feature_idx']
greedy_selected_columns_index=selected_column_indice.tolist()
greedy_selected_colname_list = df_before_match_out_training.columns[greedy_selected_columns_index].tolist()
print("Selected columns by simple greedy sequential forward selection are: \n",greedy_selected_colname_list)


Selected columns by simple greedy sequential forward selection are: 
 ['buildUpPlayPassing_away', 'IWH', 'chanceCreationCrossing_home', 'B365D', 'WHA', 'buildUpPlayPassing_home', 'defencePressure_home', 'B365H', 'buildUpPlayDribbling_home', 'defenceAggression_away', 'WHH', 'defenceTeamWidth_away', 'buildUpPlaySpeed_home', 'buildUpPlaySpeed_away', 'chanceCreationCrossing_away']

In [28]:
lr = linear_model.LinearRegression()
sfs_float = SFS(lr, 
           k_features=df_before_match_out_training.shape[1], 
           forward=True, 
           floating=True, 
           verbose=2,
           scoring='neg_mean_squared_error',
           cv=10)
sfs_float = sfs_float.fit(df_before_match_out_training.as_matrix(), df_before_match_out_trainingtarget.as_matrix())
fig = plot_sfs(sfs_float.get_metric_dict(), kind='std_err')
fig.set_size_inches(18.5, 10.5, forward=True)
plt.title('Sequential Forward Selection (w. StdErr)')
plt.grid()
plt.show()


[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  41 out of  41 | elapsed:    0.4s finished

[2017-11-13 00:47:59] Features: 1/41 -- score: -58.7289698381[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  40 out of  40 | elapsed:    0.4s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s finished

[2017-11-13 00:47:59] Features: 2/41 -- score: -53.3892854073[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  39 out of  39 | elapsed:    0.4s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   2 out of   2 | elapsed:    0.0s finished

[2017-11-13 00:47:59] Features: 3/41 -- score: -52.5486830747[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  38 out of  38 | elapsed:    0.4s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   3 out of   3 | elapsed:    0.0s finished

[2017-11-13 00:48:00] Features: 4/41 -- score: -51.6461824979[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  37 out of  37 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   4 out of   4 | elapsed:    0.0s finished

[2017-11-13 00:48:00] Features: 5/41 -- score: -51.2902865218[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  36 out of  36 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   5 out of   5 | elapsed:    0.1s finished

[2017-11-13 00:48:01] Features: 6/41 -- score: -51.1051971651[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  35 out of  35 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   6 out of   6 | elapsed:    0.1s finished

[2017-11-13 00:48:01] Features: 6/41 -- score: -50.8421418182[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  35 out of  35 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   6 out of   6 | elapsed:    0.1s finished

[2017-11-13 00:48:02] Features: 7/41 -- score: -50.7796373985[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  34 out of  34 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   7 out of   7 | elapsed:    0.1s finished

[2017-11-13 00:48:03] Features: 8/41 -- score: -50.7294001724[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  33 out of  33 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   8 out of   8 | elapsed:    0.1s finished

[2017-11-13 00:48:03] Features: 8/41 -- score: -50.5746128643[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  33 out of  33 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   8 out of   8 | elapsed:    0.1s finished

[2017-11-13 00:48:04] Features: 9/41 -- score: -50.5311691647[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  32 out of  32 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   9 out of   9 | elapsed:    0.1s finished

[2017-11-13 00:48:05] Features: 10/41 -- score: -50.49037586[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  31 out of  31 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  10 out of  10 | elapsed:    0.2s finished

[2017-11-13 00:48:05] Features: 11/41 -- score: -50.4782939114[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  30 out of  30 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  11 out of  11 | elapsed:    0.2s finished

[2017-11-13 00:48:06] Features: 12/41 -- score: -50.4661707302[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  29 out of  29 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  12 out of  12 | elapsed:    0.2s finished

[2017-11-13 00:48:07] Features: 13/41 -- score: -50.4614059101[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  28 out of  28 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  13 out of  13 | elapsed:    0.3s finished

[2017-11-13 00:48:08] Features: 14/41 -- score: -50.3752532288[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  27 out of  27 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  14 out of  14 | elapsed:    0.3s finished

[2017-11-13 00:48:09] Features: 14/41 -- score: -50.3479270261[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  27 out of  27 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  14 out of  14 | elapsed:    0.3s finished

[2017-11-13 00:48:10] Features: 14/41 -- score: -50.3353641957[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  27 out of  27 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  14 out of  14 | elapsed:    0.3s finished

[2017-11-13 00:48:11] Features: 15/41 -- score: -50.3362224873[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  26 out of  26 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  15 out of  15 | elapsed:    0.3s finished

[2017-11-13 00:48:12] Features: 16/41 -- score: -50.344178819[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  25 out of  25 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  16 out of  16 | elapsed:    0.4s finished

[2017-11-13 00:48:13] Features: 17/41 -- score: -50.3645147044[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  24 out of  24 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  17 out of  17 | elapsed:    0.4s finished

[2017-11-13 00:48:14] Features: 17/41 -- score: -50.3629886102[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  24 out of  24 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  17 out of  17 | elapsed:    0.4s finished

[2017-11-13 00:48:15] Features: 18/41 -- score: -50.3667424162[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  23 out of  23 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  18 out of  18 | elapsed:    0.5s finished

[2017-11-13 00:48:16] Features: 19/41 -- score: -50.3786141296[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  22 out of  22 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  19 out of  19 | elapsed:    0.5s finished

[2017-11-13 00:48:17] Features: 20/41 -- score: -50.3939524977[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  21 out of  21 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  20 out of  20 | elapsed:    0.6s finished

[2017-11-13 00:48:18] Features: 21/41 -- score: -50.4312769423[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  20 out of  20 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  21 out of  21 | elapsed:    0.6s finished

[2017-11-13 00:48:19] Features: 22/41 -- score: -50.4887113486[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  19 out of  19 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  22 out of  22 | elapsed:    0.7s finished

[2017-11-13 00:48:21] Features: 23/41 -- score: -50.5455021142[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  18 out of  18 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  23 out of  23 | elapsed:    0.7s finished

[2017-11-13 00:48:22] Features: 23/41 -- score: -50.5407926476[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  18 out of  18 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  23 out of  23 | elapsed:    0.7s finished

[2017-11-13 00:48:23] Features: 24/41 -- score: -50.6017427723[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  17 out of  17 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  25 out of  25 | elapsed:    0.9s finished

[2017-11-13 00:48:25] Features: 25/41 -- score: -50.6695389805[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  16 out of  16 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  25 out of  25 | elapsed:    0.8s finished

[2017-11-13 00:48:26] Features: 25/41 -- score: -50.6658717205[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  16 out of  16 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  25 out of  25 | elapsed:    0.8s finished

[2017-11-13 00:48:28] Features: 26/41 -- score: -50.7330640587[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  15 out of  15 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  26 out of  26 | elapsed:    0.9s finished

[2017-11-13 00:48:29] Features: 27/41 -- score: -50.8030279956[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  14 out of  14 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  27 out of  27 | elapsed:    0.9s finished

[2017-11-13 00:48:30] Features: 27/41 -- score: -50.7654601664[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  14 out of  14 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  27 out of  27 | elapsed:    0.9s finished

[2017-11-13 00:48:32] Features: 28/41 -- score: -50.8287279344[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  13 out of  13 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  28 out of  28 | elapsed:    1.0s finished

[2017-11-13 00:48:33] Features: 29/41 -- score: -50.8939539017[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  12 out of  12 | elapsed:    0.5s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  29 out of  29 | elapsed:    1.2s finished

[2017-11-13 00:48:35] Features: 30/41 -- score: -50.9712503962[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  11 out of  11 | elapsed:    0.7s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  30 out of  30 | elapsed:    1.6s finished

[2017-11-13 00:48:37] Features: 31/41 -- score: -51.0484175464[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  10 out of  10 | elapsed:    0.6s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  31 out of  31 | elapsed:    1.4s finished

[2017-11-13 00:48:39] Features: 31/41 -- score: -51.0473070694[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  10 out of  10 | elapsed:    0.4s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  31 out of  31 | elapsed:    1.3s finished

[2017-11-13 00:48:41] Features: 32/41 -- score: -51.1344295798[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   9 out of   9 | elapsed:    0.4s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  32 out of  32 | elapsed:    1.4s finished

[2017-11-13 00:48:43] Features: 33/41 -- score: -51.2316552168[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   8 out of   8 | elapsed:    0.4s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  33 out of  33 | elapsed:    1.6s finished

[2017-11-13 00:48:45] Features: 34/41 -- score: -51.3411138789[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   7 out of   7 | elapsed:    0.3s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  34 out of  34 | elapsed:    1.9s finished

[2017-11-13 00:48:47] Features: 35/41 -- score: -51.4608332034[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   6 out of   6 | elapsed:    0.3s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  35 out of  35 | elapsed:    1.8s finished

[2017-11-13 00:48:49] Features: 36/41 -- score: -51.5775691055[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   5 out of   5 | elapsed:    0.3s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  36 out of  36 | elapsed:    1.7s finished

[2017-11-13 00:48:51] Features: 36/41 -- score: -51.5610306069[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   5 out of   5 | elapsed:    0.3s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  36 out of  36 | elapsed:    2.0s finished

[2017-11-13 00:48:54] Features: 37/41 -- score: -51.6776422551[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   4 out of   4 | elapsed:    0.2s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  37 out of  37 | elapsed:    2.6s finished

[2017-11-13 00:48:56] Features: 38/41 -- score: -51.8162235084[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   3 out of   3 | elapsed:    0.3s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  38 out of  38 | elapsed:    2.4s finished

[2017-11-13 00:48:59] Features: 39/41 -- score: -51.9941470661[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   2 out of   2 | elapsed:    0.1s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  39 out of  39 | elapsed:    2.1s finished

[2017-11-13 00:49:01] Features: 40/41 -- score: -52.1689079911[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  40 out of  40 | elapsed:    2.5s finished

[2017-11-13 00:49:04] Features: 40/41 -- score: -52.1612512491[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s finished
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s remaining:    0.0s
[Parallel(n_jobs=1)]: Done  40 out of  40 | elapsed:    2.6s finished

[2017-11-13 00:49:06] Features: 41/41 -- score: -52.3437553235

In [29]:
df_features_forward_float = pd.DataFrame.from_dict(sfs_float.get_metric_dict()).T
df_features_forward_float


Out[29]:
avg_score ci_bound cv_scores feature_idx std_dev std_err
1 -58.729 13.6689 [-37.4677973768, -33.6521225601, -42.446939286... (8,) 18.404 6.13466
2 -53.3893 11.8031 [-37.4085971788, -33.3538213249, -38.17086898,... (8, 14) 15.8919 5.29729
3 -52.5487 11.5306 [-40.5448889297, -33.7908060261, -36.130671567... (8, 4, 14) 15.525 5.17499
4 -51.6462 11.6248 [-40.9979286367, -34.3073129744, -33.714687223... (8, 18, 4, 14) 15.6518 5.21727
5 -51.2903 11.7016 [-39.0898452124, -33.8116966977, -34.431368342... (4, 8, 14, 18, 19) 15.7553 5.25175
6 -50.8421 11.1963 [-38.5097691075, -34.4637828447, -35.565556063... (4, 8, 16, 18, 19, 29) 15.0748 5.02494
7 -50.7796 11.2007 [-38.3837111765, -34.2938601097, -35.571738831... (4, 37, 8, 16, 18, 19, 29) 15.0808 5.02693
8 -50.5746 11.0895 [-38.5931147694, -34.6772062187, -35.846991528... (4, 9, 16, 18, 19, 21, 29, 37) 14.931 4.97701
9 -50.5312 11.0712 [-38.486072539, -34.4796060666, -36.3341969211... (4, 9, 16, 18, 19, 21, 29, 31, 37) 14.9064 4.96881
10 -50.4904 11.0942 [-37.9098446834, -34.0598054135, -36.211676097... (4, 9, 16, 18, 19, 21, 29, 31, 32, 37) 14.9374 4.97914
11 -50.4783 11.1196 [-37.876265224, -33.9687137999, -36.2417005184... (4, 9, 16, 18, 19, 21, 29, 31, 32, 33, 37) 14.9716 4.99054
12 -50.4662 11.1501 [-37.7902927233, -33.7462770825, -36.074667224... (4, 9, 16, 18, 19, 21, 25, 29, 31, 32, 33, 37) 15.0127 5.00422
13 -50.4614 11.185 [-37.6993005008, -33.6175561993, -36.101592539... (4, 9, 16, 18, 19, 21, 25, 29, 31, 32, 33, 34,... 15.0597 5.01989
14 -50.3354 10.6071 [-37.162695323, -34.4296880226, -37.4500769792... (4, 9, 16, 19, 21, 25, 26, 27, 29, 31, 32, 33,... 14.2815 4.7605
15 -50.3362 10.6217 [-37.0776413792, -34.3946904375, -37.428523195... (4, 9, 15, 16, 19, 21, 25, 26, 27, 29, 31, 32,... 14.3012 4.76708
16 -50.3442 10.6757 [-37.1323843756, -34.2214594917, -37.324255878... (4, 9, 15, 16, 19, 21, 25, 26, 27, 29, 31, 32,... 14.3739 4.79129
17 -50.363 10.6773 [-36.7784028323, -34.4768877999, -37.773264323... (4, 7, 9, 15, 16, 18, 19, 21, 25, 26, 27, 29, ... 14.3761 4.79205
18 -50.3667 10.7251 [-36.8159088189, -34.3254591766, -37.676084400... (4, 7, 9, 15, 16, 18, 19, 21, 25, 26, 27, 29, ... 14.4404 4.81347
19 -50.3786 10.5241 [-37.7495896581, -34.1763476028, -37.216329679... (2, 4, 7, 9, 15, 16, 18, 19, 21, 25, 26, 27, 2... 14.1698 4.72328
20 -50.394 10.6502 [-37.4859018658, -33.9170173776, -37.100808598... (2, 4, 7, 9, 15, 16, 18, 19, 21, 23, 25, 26, 2... 14.3396 4.77988
21 -50.4313 10.6488 [-37.4903287728, -33.8767380398, -37.093130946... (2, 4, 7, 9, 15, 16, 18, 19, 21, 23, 25, 26, 2... 14.3377 4.77923
22 -50.4887 10.6815 [-37.5068026088, -33.8584169043, -37.247595670... (2, 4, 7, 9, 15, 16, 18, 19, 21, 23, 25, 26, 2... 14.3817 4.7939
23 -50.5408 10.6247 [-37.521092032, -33.9753141735, -37.3668478931... (2, 4, 7, 9, 15, 16, 18, 19, 21, 23, 24, 25, 2... 14.3052 4.7684
24 -50.6017 10.6146 [-37.5529634473, -33.9454593459, -37.358597965... (2, 4, 7, 9, 15, 16, 18, 19, 21, 23, 24, 25, 2... 14.2917 4.7639
25 -50.6659 10.5087 [-38.0501228736, -33.5693908449, -37.190543296... (0, 2, 4, 7, 9, 15, 16, 18, 19, 21, 23, 24, 25... 14.1491 4.71636
26 -50.7331 10.5333 [-38.075094857, -33.5614239039, -37.3895592559... (0, 2, 4, 7, 9, 15, 16, 18, 19, 21, 23, 24, 25... 14.1822 4.72739
27 -50.7655 10.4942 [-38.8268682662, -34.0682013394, -37.013885887... (0, 2, 3, 4, 7, 9, 15, 16, 17, 18, 19, 21, 23,... 14.1295 4.70983
28 -50.8287 10.4126 [-38.7448465026, -34.1270113442, -37.14831564,... (0, 2, 3, 4, 7, 9, 15, 16, 17, 18, 19, 21, 23,... 14.0196 4.67321
29 -50.894 10.4471 [-38.615153899, -34.2656497336, -37.0455573175... (0, 2, 3, 4, 7, 9, 12, 15, 16, 17, 18, 19, 21,... 14.0662 4.68873
30 -50.9713 10.5985 [-38.4245009399, -34.1142477321, -37.219373073... (0, 2, 3, 4, 7, 9, 12, 15, 16, 17, 18, 19, 20,... 14.27 4.75666
31 -51.0473 10.66 [-38.1303994507, -34.4249260491, -37.167361629... (0, 1, 2, 3, 4, 7, 9, 12, 14, 15, 16, 17, 18, ... 14.3528 4.78427
32 -51.1344 10.5108 [-39.8009517129, -34.0410975053, -37.520008653... (0, 1, 2, 3, 4, 7, 9, 12, 14, 15, 16, 17, 18, ... 14.152 4.71732
33 -51.2317 10.5188 [-39.730844615, -33.9253466461, -37.6525288368... (0, 1, 2, 3, 4, 7, 9, 12, 14, 15, 16, 17, 18, ... 14.1627 4.7209
34 -51.3411 10.5473 [-39.804217926, -33.9642141989, -37.6346325265... (0, 1, 2, 3, 4, 6, 7, 9, 12, 14, 15, 16, 17, 1... 14.2011 4.7337
35 -51.4608 10.5702 [-39.7562857084, -33.9024652978, -37.731242904... (0, 1, 2, 3, 4, 6, 7, 9, 12, 14, 15, 16, 17, 1... 14.2319 4.74397
36 -51.561 10.6293 [-39.8306171226, -33.9311894079, -37.610886776... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16,... 14.3114 4.77047
37 -51.6776 10.6524 [-39.7812764787, -33.8648868569, -37.706374010... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16,... 14.3426 4.78085
38 -51.8162 10.5379 [-40.0225616642, -34.6215216995, -38.021994292... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16,... 14.1884 4.72948
39 -51.9941 10.4788 [-40.7927401909, -34.6496941834, -38.745911429... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15,... 14.1088 4.70293
40 -52.1613 10.9703 [-40.8142048281, -33.2719365274, -38.866660293... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 14.7705 4.92351
41 -52.3438 10.8884 [-41.0492286076, -33.982064226, -39.1396631043... (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 14.6603 4.88676

float solution:


In [30]:
float_selected_columns_index=list()

selected_column_indice=df_features_forward_float[df_features_forward_float['avg_score'] == df_features_forward_float['avg_score'].max()]['feature_idx']
float_selected_columns_index=selected_column_indice.tolist()
float_selected_colname_list = df_before_match_out_training.columns[float_selected_columns_index].tolist()
print("Selected columns by float greedy sequential forward selection are: \n",float_selected_colname_list)


Selected columns by float greedy sequential forward selection are: 
 ['buildUpPlayPassing_away', 'chanceCreationCrossing_home', 'WHA', 'defencePressure_home', 'B365H', 'VCA', 'buildUpPlayDribbling_home', 'LBA', 'defenceAggression_away', 'WHH', 'defenceTeamWidth_away', 'VCD', 'buildUpPlaySpeed_home', 'chanceCreationCrossing_away']

Use the selected columns from both simple greedy and float greedy to use on the outter layer holdout validation

1. Simple Greedy


In [31]:
df_before_match_greedy_training=df_before_match_out_training[greedy_selected_colname_list]
df_before_match_greedy_test=df_before_match_out_test[greedy_selected_colname_list]

lr_greedy = linear_model.LinearRegression()
lr_greedy.fit(df_before_match_greedy_training.as_matrix(), df_before_match_out_trainingtarget.as_matrix())
before_match_greedy_pred = lr_greedy.predict(df_before_match_greedy_test.as_matrix())


print(r2_score(df_before_match_out_testtarget.tolist(), before_match_greedy_pred.tolist()))


0.419410932893

In [32]:
df_before_match_float_training=df_before_match_out_training[float_selected_colname_list]
df_before_match_float_test=df_before_match_out_test[float_selected_colname_list]

lr_greedy = linear_model.LinearRegression()
lr_greedy.fit(df_before_match_float_training.as_matrix(), df_before_match_out_trainingtarget.as_matrix())
before_match_float_pred = lr_greedy.predict(df_before_match_float_test.as_matrix())


print(r2_score(df_before_match_out_testtarget.tolist(), before_match_float_pred.tolist()))


0.411118387205

ANN


In [33]:
df_before_match.head()


Out[33]:
B365A BWH IWD defenceTeamWidth_home buildUpPlayPassing_away IWA LBH LBD IWH chanceCreationCrossing_home ... defenceTeamWidth_away VCD buildUpPlaySpeed_home defenceAggression_home defencePressure_away buildUpPlaySpeed_away BWA chanceCreationCrossing_away chanceCreationShooting_home possession_home
0 4.33 1.80 3.40 45 65 4.30 1.80 3.30 1.80 70 ... 40 3.40 70 55 40 60 4.00 70 70 57
1 2.10 3.45 3.20 35 59 2.20 3.30 3.25 3.20 70 ... 30 3.25 70 70 30 70 2.05 70 50 57
2 4.50 1.72 3.50 30 70 4.60 1.80 3.30 1.75 70 ... 70 3.50 58 70 70 70 4.50 70 50 60
3 2.88 2.45 3.20 70 70 2.85 2.38 3.20 2.40 70 ... 35 3.25 70 70 35 65 2.75 70 70 51
4 3.75 2.00 3.25 35 70 3.40 2.10 3.20 2.10 70 ... 35 3.25 60 70 35 55 3.65 70 55 53

5 rows × 42 columns


In [34]:
print(before_match_attributes)


['B365A', 'BWH', 'IWD', 'defenceTeamWidth_home', 'buildUpPlayPassing_away', 'IWA', 'LBH', 'LBD', 'IWH', 'chanceCreationCrossing_home', 'WHD', 'buildUpPlayPositioningClass_home_isOrganised', 'BWD', 'buildUpPlayDribbling_away', 'B365D', 'stage', 'WHA', 'chanceCreationPositioningClass_home_isOrganised', 'buildUpPlayPassing_home', 'defencePressure_home', 'buildUpPlayPositioningClass_away_isOrganised', 'B365H', 'chanceCreationPositioningClass_away_isOrganised', 'chanceCreationPassing_home', 'chanceCreationShooting_away', 'VCA', 'buildUpPlayDribbling_home', 'LBA', 'chanceCreationPassing_away', 'defenceAggression_away', 'VCH', 'WHH', 'defenceTeamWidth_away', 'VCD', 'buildUpPlaySpeed_home', 'defenceAggression_home', 'defencePressure_away', 'buildUpPlaySpeed_away', 'BWA', 'chanceCreationCrossing_away', 'chanceCreationShooting_home']

In [35]:
#before_match_attributes = ['LBH']

In [36]:
# ANN
from sklearn.neural_network import MLPRegressor
from sklearn.model_selection import train_test_split

df = df_before_match

train_df, test_df = train_test_split(df, test_size=0.2)

trainX = train_df[before_match_attributes]
trainY = train_df['possession_home']

testX = test_df[before_match_attributes]
testY = test_df['possession_home']

fnn = MLPRegressor(solver='adam', alpha=1e-2,
                    hidden_layer_sizes=(64, 32, ),
                    random_state=1,
                    nesterovs_momentum=False,
                    momentum=0.99,
                    early_stopping=False,
                    activation='logistic',
                    batch_size=16,
                    warm_start=False,
                    max_iter=3000)

#fnn = MLPRegressor(solver='adam', alpha=1e-3,
#                    hidden_layer_sizes=(256,128,64,32,),
#                    random_state=1,
#                    nesterovs_momentum=False,
#                    momentum=0.99,
#                    early_stopping=False,
#                    activation='logistic',
#                    batch_size=32,
#                    warm_start=False,
#                  max_iter=3000)

model = fnn.fit(trainX, trainY)

In [37]:
print(model)
print(model.loss_curve_)
print(model.n_layers_)


MLPRegressor(activation='logistic', alpha=0.01, batch_size=16, beta_1=0.9,
       beta_2=0.999, early_stopping=False, epsilon=1e-08,
       hidden_layer_sizes=(64, 32), learning_rate='constant',
       learning_rate_init=0.001, max_iter=3000, momentum=0.99,
       nesterovs_momentum=False, power_t=0.5, random_state=1, shuffle=True,
       solver='adam', tol=0.0001, validation_fraction=0.1, verbose=False,
       warm_start=False)
[1200.1425832479626, 1030.8465655639943, 901.73341935577207, 790.65377009995586, 692.09592681624565, 604.15318972276862, 525.70986952476676, 454.08097856591775, 382.89424855528421, 324.24603921633218, 274.68048144383471, 228.56603446217903, 187.91930165888178, 156.02846421500601, 130.29681098832424, 109.59223502768197, 93.0250131856953, 79.867372008856222, 69.569877191645929, 61.631809712298313, 55.61156768653553, 51.134339526499694, 47.881628534513965, 45.550181772278329, 43.929284102276391, 42.822140436939144, 42.101093626371437, 41.641600736998875, 41.35119329378, 41.174582803483325, 40.876558131194166, 38.687902362345525, 35.074774448373084, 33.364493519753438, 31.424531514217403, 30.243282151138988, 28.886210078127032, 28.601150702207452, 27.555117363406492, 27.430190503832666, 26.863470417340213, 26.181426457897174, 25.941187239312946, 25.93225766136047, 25.760779857739738, 25.217683265513465, 25.280890686112567, 25.332715373120607, 25.207470006542547, 25.310669850937554, 24.989191694026729, 24.952350630070903, 25.081061309572842, 24.782444233306872, 24.528562478035116, 24.540893107118972, 24.331748563943982, 24.439230906599427, 24.694451405380704, 24.6375830193345]
4

In [38]:
#model.predict(testX) - testY
y_pred = model.predict(testX)
y_true = testY
mean_squared_error(y_true, y_pred)


Out[38]:
49.099689995701375

In [39]:
print("Predicted: " + str(model.predict(testX.iloc[470].values.reshape(1, -1))) + ", actual: " + str(testY.iloc[470]))

print("Predicted: " + str(model.predict(testX.iloc[123].values.reshape(1, -1))) + ", actual: " + str(testY.iloc[123]))

print("Predicted: " + str(model.predict(testX.iloc[321].values.reshape(1, -1))) + ", actual: " + str(testY.iloc[321]))

print("Predicted: " + str(model.predict(testX.iloc[420].values.reshape(1, -1))) + ", actual: " + str(testY.iloc[420]))


Predicted: [ 46.6441023], actual: 41
Predicted: [ 52.60814435], actual: 36
Predicted: [ 57.0227647], actual: 55
Predicted: [ 43.43182945], actual: 41

In [56]:
from sklearn.model_selection import KFold

linear_features = ['buildUpPlayPassing_home', 'defenceTeamWidth_away', 'B365H',
                   'buildUpPlayDribbling_home', 'buildUpPlaySpeed_home', 'chanceCreationShooting_away',
                   'IWA', 'chanceCreationCrossing_home', 'buildUpPlaySpeed_away',
                   'buildUpPlayPassing_away', 'defenceAggression_away', 'defencePressure_home']


X_fnn = df[before_match_attributes]
X_lin = df[linear_features]
y = df['possession_home']

K = 10
v = K - 1


kf = KFold(n_splits=K, shuffle=True)

fnn_tests = []
lin_tests = []
avg_tests = []

for train_index, test_index in kf.split(X_fnn):
   
    X_train_fnn, X_test_fnn = X_fnn.iloc[train_index], X_fnn.iloc[test_index]
    X_train_lin, X_test_lin = X_lin.iloc[train_index], X_lin.iloc[test_index]
    y_train, y_test = y.iloc[train_index], y.iloc[test_index]
    fnn_fit = fnn.fit(X_train_fnn, y_train)
    y_pred_fnn = fnn_fit.predict(X_test_fnn)
    mse_fnn = mean_squared_error(y_test, y_pred_fnn)
    print("FNN: " + str(mse_fnn))
    fnn_tests.append(mse_fnn)
    
    lin_model = linear_model.LinearRegression()
    lin_fit = lin_model.fit(X_train_lin, y_train)
    y_pred_lin = lin_fit.predict(X_test_lin)
    mse_lin = mean_squared_error(y_test, y_pred_lin)
    print("LIN: " + str(mse_lin))
    lin_tests.append(mse_lin)
    
    y_train_avg = sum(y_train) / len(y_train)
    y_pred_const = np.array([y_train_avg] * len(y_test))
    mse_const = mean_squared_error(y_test, y_pred_const)
    print("AVG: " + str(mse_const))
    avg_tests.append(mse_const)
    print("AVG prediction: " + str(y_train_avg))

print("FNN CV MSE: " + str(np.mean(fnn_tests)))
print("Linear model CV MSE: " + str(np.mean(lin_tests)))
print("Const AVG CV MSE: " + str(np.mean(avg_tests)))


FNN: 53.7428261879
LIN: 51.602221394
AVG: 83.3800597243
AVG prediction: 51.6256386438
FNN: 58.1194347358
LIN: 58.7772897795
AVG: 89.1005939237
AVG prediction: 51.709707385
FNN: 47.9960029345
LIN: 47.1463835481
AVG: 78.1850063797
AVG prediction: 51.5777984208
FNN: 46.0596158855
LIN: 39.2022045417
AVG: 76.8370232991
AVG prediction: 51.6750232126
FNN: 49.4881387847
LIN: 49.4301577786
AVG: 85.0996755172
AVG prediction: 51.6490250696
FNN: 56.1728310064
LIN: 56.9155555269
AVG: 85.1482352669
AVG prediction: 51.6592386258
FNN: 49.0539094851
LIN: 51.8051889093
AVG: 94.7636585288
AVG prediction: 51.6360259981
FNN: 46.8305870129
LIN: 45.4211481654
AVG: 80.5145389057
AVG prediction: 51.6573816156
FNN: 42.6963958484
LIN: 43.4951065703
AVG: 71.9669609269
AVG prediction: 51.5766016713
FNN: 55.1506126796
LIN: 49.9174763131
AVG: 72.2146229113
AVG prediction: 51.6063138347
FNN CV MSE: 50.5310354561
Linear model CV MSE: 49.3712732527
Const AVG CV MSE: 81.7210375384

In [58]:
# Performance comparison
# K=10, v=9
alpha = 0.05
zs = np.array(fnn_tests) - np.array(lin_tests)
z_bar = np.mean(zs)
std_z_bar = np.std(zs)

from scipy.stats import t

theta_l = z_bar + std_z_bar * t.ppf(alpha/2, v)
theta_u = z_bar + std_z_bar * t.ppf(1 - alpha/2, v)
print("z: " + str(z_bar))
print("theta_l: " + str(theta_l))
print("theta_u: " + str(theta_u))


z: 1.15976220341
theta_l: -5.13558727048
theta_u: 7.45511167731